home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / c3 / pro24 / cmtprog.h < prev    next >
C/C++ Source or Header  |  1986-08-07  |  1KB  |  50 lines

  1. /* cmtprog.h -- include file for cmt application programs */
  2.  
  3. /* define true, false, private, boolean */
  4. #include "cext.h"
  5. #include "mpu.h"
  6.  
  7. /*
  8.  * override the definition of l_rest
  9.  */
  10. #define l_rest(d) m_rest(d)
  11. #define l_restuntil(t) m_restuntil(t)
  12.  
  13. #define rest(x) l_rest( (long) x )
  14. #define restuntil(x) l_restuntil( (long) x)
  15.  
  16. #define when if (
  17. #define then ) {
  18. #define otherwise ;} else {
  19. #define endif ;}
  20. #define endwhen ;}
  21. #define begin {
  22. #define end ;}
  23.  
  24. #define repeat(var, count) {int var; for (var=1; var <= count; var++) {
  25. #define endrep ;}}
  26.  
  27. extern long event_time;
  28.  
  29. int moxc_loudness = 127;
  30.  
  31. #define loud(l) moxc_loudness = (l);
  32.  
  33. /* pnote -- play a note, return immediately */
  34. /**/
  35. void pnote(pitch, duration)
  36.     begin
  37.     midi_note(1, pitch, moxc_loudness);
  38.     cause(duration, midi_note, 1, pitch, 0);
  39.     end
  40.  
  41.  
  42. /* note -- play a note, return after end of note */
  43. /**/
  44. void note(pitch, duration)
  45.     begin
  46.         midi_note(1, pitch, moxc_loudness);
  47.     rest(duration);
  48.     midi_note(1, pitch, 0);
  49.     end
  50.